package com.slz3.business.module.memberManagement.memCollect.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.memberManagement.memCollect.domain.MemCollect;
import com.slz3.business.module.memberManagement.memCollect.domain.MemCollectCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class MemCollectResController {

    static Mono<ServerResponse> add(ServerRequest req, MemCollect memCollect) {
        if (MemCollectResUnsafeValid.add(req, memCollect)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemCollectResAtomic.add_$MemCollectUpdateLock(req, memCollect);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, MemCollectCondition memCollectCondition) {
        if (MemCollectResUnsafeValid.delete(req, memCollectCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemCollectResAtomic.delete_$MemCollectUpdateLock(req, memCollectCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, MemCollect memCollect) {
        if (MemCollectResUnsafeValid.modify(req, memCollect)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemCollectResAtomic.modify_$MemCollectUpdateLock(req, memCollect);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (MemCollectResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemCollectResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (MemCollectResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemCollectResAtomic.info_$MemCollectUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (MemCollectResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemCollectResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, MemCollectCondition memCollectCondition) {
        //
        if (MemCollectResUnsafeValid.auditSubmit(req, memCollectCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemCollectResAtomic.auditSubmit_$MemCollectUpdateLock(req, memCollectCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, MemCollectCondition memCollectCondition) {
        if (MemCollectResUnsafeValid.audit(req, memCollectCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemCollectResAtomic.audit_$MemCollectUpdateLock(req, memCollectCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, MemCollectCondition memCollectCondition) {
        if (MemCollectResUnsafeValid.auditReject(req, memCollectCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemCollectResAtomic.auditReject_$MemCollectUpdateLock(req, memCollectCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, MemCollectCondition memCollectCondition) {
        if (MemCollectResUnsafeValid.usingEnable(req, memCollectCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemCollectResAtomic.usingEnable_$MemCollectUpdateLock(req, memCollectCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, MemCollectCondition memCollectCondition) {
        if (MemCollectResUnsafeValid.usingDisable(req, memCollectCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemCollectResAtomic.usingDisable_$MemCollectUpdateLock(req, memCollectCondition);
        }
    }

}
